package org.linlinjava.litemall.db.domain;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@TableName("litemall_user_member")
@ApiModel(value = "LitemallUserMember对象", description = "用户会员表")
public class LitemallUserMember {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "主键ID")
    private Integer id;

    @TableField("user_id")
    @ApiModelProperty(value = "用户id")
    private Integer userId;

    @TableField("nickname")
    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    @TableField("member_rule_id")
    @ApiModelProperty(value = "会员规则id")
    private Integer memberRuleId;

    @TableField("member_rule_name")
    @ApiModelProperty(value = "会员规则名字")
    private String memberRuleName;

    @TableField("expiration_time")
    @ApiModelProperty(value = "过期时间")
    private LocalDateTime expirationTime;

    @TableField("effective")
    @ApiModelProperty(value = "是否生效中，0：未生效，1：已生效   2 冻结中")
    private String effective;

    @TableField("add_time")
    @ApiModelProperty(value = "添加时间")
    private LocalDateTime addTime;

    @TableField("update_time")
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    @TableField("deleted")
    @ApiModelProperty(value = "逻辑删除")
    @TableLogic(delval = "1",value = "0")
    private Boolean deleted;


    /**
     * 名字
     */
    @TableField(exist = false)
    private String name;

    /**
     * 用户名称
     */
    @TableField(exist = false)
    private String username;

    /**
     * 用户密码
     */
    @TableField(exist = false)
    private String password;

    /**
     * 性别：0 未知， 1男， 1 女
     */
    @TableField(exist = false)
    private Byte gender;

    /**
     * 生日
     */
    @TableField(exist = false)
    private LocalDate birthday;

    /**
     * 最近一次登录时间
     */
    @TableField(exist = false)
    private LocalDateTime lastLoginTime;

    /**
     * 最近一次登录IP地址
     */
    @TableField(exist = false)
    private String lastLoginIp;

    /**
     * 0 普通用户，1 VIP用户，2 高级VIP用户
     */
    @TableField(exist = false)
    private Integer userLevel;



    /**
     * 用户手机号码
     */

    @TableField(exist = false)
    private String mobile;

    /**
     * 身份证号
     */
    @TableField(exist = false)
    private String idCard;

    /**
     * 用户头像图片
     */
    @TableField(exist =false)
    private String avatar;

    /**
     * 微信登录openid
     */
    @TableField(exist = false)
    private String weixinOpenid;

    /**
     * 微信登录unionid
     */
    @TableField(exist = false)
    private String weixinUnionid;

    /**
     * 微信登录会话KEY
     */
    @TableField(exist = false)
    private String sessionKey;

    /**
     * 余额
     */

    @TableField(exist = false)
    private BigDecimal balance;

    /**
     * 0 可用, 1 禁用, 2 注销
     */
    @TableField(exist = false)
    private Byte status;

    /**
     * 是否分销商
     */
    @TableField(exist = false)
    private Boolean isReseller;

    /**
     * 上级ID
     */
    @TableField(exist = false)
    private Integer pid;

    /**
     * 累计消费金额
     */
    @TableField(exist=false)
    private BigDecimal costMoney;

    /**
     * 用户金额，实际消费金额+充值金额
     */
    @TableField(exist=false)
    private BigDecimal inMoney;

    /**
     * 0:未交押金，1：已交押金
     */
    @TableField(exist=false)
    private Boolean hasPayDeposit;


    /**
     * 冻结天数
     */
    @TableField(exist=false)
    private Integer freeDays=0;

    /**
     * 押金金额
     */
    @TableField
    private BigDecimal deposit;

    /**
     * 邀请人数
     */
    @TableField(exist=false)
    private Integer numberOfInvitations;

    /**
     * 邀请获益天数
     */
    @TableField(exist=false)
    private Integer invitationBenefitDays;

    /**
     * 邀请获益金额
     */
    @TableField(exist=false)
    private BigDecimal invitationBenefitAmount;


    @TableField(exist = false)
    private LitemallMemberTimes times;








    /**
     * This enum was generated by MyBatis Generator.
     * This enum corresponds to the database table litemall_user_member
     *
     * @mbg.generated
     */
    public enum Deleted {
        NOT_DELETED(new Boolean("0"), "未删除"),
        IS_DELETED(new Boolean("1"), "已删除");

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final Boolean value;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final String name;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        Deleted(Boolean value, String name) {
            this.value = value;
            this.name = name;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public Boolean getValue() {
            return this.value;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public Boolean value() {
            return this.value;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getName() {
            return this.name;
        }
    }

    /**
     * This enum was generated by MyBatis Generator.
     * This enum corresponds to the database table litemall_user_member
     *
     * @mbg.generated
     */
    public enum Column {
        id("id", "id", "INTEGER", false),
        userId("user_id", "userId", "INTEGER", false),
        nickname("nickname", "nickname", "VARCHAR", false),
        memberRuleId("member_rule_id", "memberRuleId", "INTEGER", false),
        memberRuleName("member_rule_name", "memberRuleName", "VARCHAR", false),
        expirationTime("expiration_time", "expirationTime", "TIMESTAMP", false),
        effective("effective", "effective", "BIT", false),
        addTime("add_time", "addTime", "TIMESTAMP", false),
        updateTime("update_time", "updateTime", "TIMESTAMP", false),
        deleted("deleted", "deleted", "BIT", false);

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private static final String BEGINNING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private static final String ENDING_DELIMITER = "`";

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final String column;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final boolean isColumnNameDelimited;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final String javaProperty;

        /**
         * This field was generated by MyBatis Generator.
         * This field corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        private final String jdbcType;

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String value() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getValue() {
            return this.column;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getJavaProperty() {
            return this.javaProperty;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getJdbcType() {
            return this.jdbcType;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
            this.column = column;
            this.javaProperty = javaProperty;
            this.jdbcType = jdbcType;
            this.isColumnNameDelimited = isColumnNameDelimited;
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String desc() {
            return this.getEscapedColumnName() + " DESC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String asc() {
            return this.getEscapedColumnName() + " ASC";
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public static Column[] excludes(Column ... excludes) {
            ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
            if (excludes != null && excludes.length > 0) {
                columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
            }
            return columns.toArray(new Column[]{});
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getEscapedColumnName() {
            if (this.isColumnNameDelimited) {
                return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
            } else {
                return this.column;
            }
        }

        /**
         * This method was generated by MyBatis Generator.
         * This method corresponds to the database table litemall_user_member
         *
         * @mbg.generated
         */
        public String getAliasedEscapedColumnName() {
            return this.getEscapedColumnName();
        }
    }
}
